<?php

declare(strict_types=1);

namespace App\CustHub\Constants;

use App\Common\Constants\AbstractBaseConstants;
use Hyperf\Constants\Annotation\Constants;

#[Constants]
class ContactStatusConstants extends AbstractBaseConstants
{
    /**
     * @Message("未验证好友")
     */
    public const UNVERIFIED_FRIEND = 0;

    /**
     * @Message("正常好友")
     */
    public const NORMAL_FRIEND = 1;

    /**
     * @Message("拉黑好友")
     */
    public const BLOCKED_FRIEND = 2;

    /**
     * @Message("流失好友")
     */
    public const LOST_FRIEND = 3;


    public static function getStatus(int $contactStatus): int
    {
        match ($contactStatus) {
            8 => $status = self::BLOCKED_FRIEND,//拉黑好友
            2057, 2313 => $status = self::NORMAL_FRIEND,//正常
            0,2049 => $status = self::LOST_FRIEND,//流失
            default => $status = self::UNVERIFIED_FRIEND//待验证
        };
        return $status;
    }
}